label: Make all code snippets properly compile
authorTimm Bäder <mail@baedert.org>
Wed, 11 Oct 2017 10:18:22 +0000 (12:18 +0200)
committerTimm Bäder <mail@baedert.org>
Wed, 11 Oct 2017 10:18:22 +0000 (12:18 +0200)
gtk/gtklabel.c

index 6774ebc28d9cafffd73582bc78f55dcf2a57d733..8116901d9e7659e10490a92ea8619a671ea48542 100644 (file)
  *
  * |[<!-- language="C" -->
  *   // Pressing Alt+H will activate this button
- *   button = gtk_button_new ();
- *   label = gtk_label_new_with_mnemonic ("_Hello");
+ *   GtkWidget *button = gtk_button_new ();
+ *   GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello");
  *   gtk_container_add (GTK_CONTAINER (button), label);
  * ]|
  *
  *
  * |[<!-- language="C" -->
  *   // Pressing Alt+H will activate this button
- *   button = gtk_button_new_with_mnemonic ("_Hello");
+ *   GtkWidget *button = gtk_button_new_with_mnemonic ("_Hello");
  * ]|
  *
  * To create a mnemonic for a widget alongside the label, such as a
  *
  * |[<!-- language="C" -->
  *   // Pressing Alt+H will focus the entry
- *   entry = gtk_entry_new ();
- *   label = gtk_label_new_with_mnemonic ("_Hello");
+ *   GtkWidget *entry = gtk_entry_new ();
+ *   GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello");
  *   gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
  * ]|
  *
  *
  * Here’s how to create a label with a small font:
  * |[<!-- language="C" -->
- *   label = gtk_label_new (NULL);
+ *   GtkWidget *label = gtk_label_new (NULL);
  *   gtk_label_set_markup (GTK_LABEL (label), "<small>Small text</small>");
  * ]|
  *
  * |[<!-- language="C" -->
  * const gchar *text =
  * "Go to the"
- * "<a href=\"http://www.gtk.org title="&lt;i&gt;Our&lt;/i&gt; website\">"
+ * "<a href=\"http://www.gtk.org title=\"&lt;i&gt;Our&lt;/i&gt; website\">"
  * "GTK+ website</a> for more...";
- * gtk_label_set_markup (label, text);
+ * GtkWidget *label = gtk_label_new (NULL);
+ * gtk_label_set_markup (GTK_LABEL (label), text);
  * ]|
  *
  * It is possible to implement custom handling for links and their tooltips with
@@ -2696,6 +2697,8 @@ gtk_label_set_markup_internal (GtkLabel    *label,
  * g_markup_escape_text() or g_markup_printf_escaped():
  *
  * |[<!-- language="C" -->
+ * GtkWidget *label = gtk_label_new (NULL);
+ * const char *str = "...";
  * const char *format = "<span style=\"italic\">\%s</span>";
  * char *markup;
  *